﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    public static GameManager Instance;

    private void Awake()
    {
        Instance = this;
        DontDestroyOnLoad(this.gameObject);
    }

    private void Start()
    {
        GameObject mapGob = LoadMap(10001);
        mapGob.transform.position = Vector3.zero;
        mapGob.AddComponent<FightManger>();
    }
    
    public GameObject LoadMap(int mapId)
    {
        string assePath = $"Maps/Prefabs/{mapId}";
        GameObject mapGob = AssetManager.Instance.LoadAndInstantiatePrefab(assePath);
        mapGob.transform.SetParent(this.transform, false);
        return mapGob;
    }
}
